<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SC2API: include/sc2api/sc2_common.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="SC2-Logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SC2API
   </div>
   <div id="projectbrief">An API for AI for StarCraft II</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_3d0dfd3160b31ffa512c49330ac8d646.html">sc2api</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">sc2_common.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="sc2__common_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacesc2.html">sc2</a> {</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="structsc2_1_1_point3_d.html">   14</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> {</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <span class="keywordtype">float</span> x;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    <span class="keywordtype">float</span> y;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <span class="keywordtype">float</span> z;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>() :</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        x(0.0f),</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        y(0.0f),</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        z(0.0f) {</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    }</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>(<span class="keywordtype">float</span> in_x, <span class="keywordtype">float</span> in_y, <span class="keywordtype">float</span> in_z) :</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        x(in_x),</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        y(in_y),</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        z(in_z) {</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    }</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; operator+=(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; operator-=(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; operator*=(<span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; operator/=(<span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;};</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> operator+(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> operator-(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> operator*(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; lhs, <span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> operator*(<span class="keywordtype">float</span> lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> operator/(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; lhs, <span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> operator/(<span class="keywordtype">float</span> lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; rhs);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structsc2_1_1_point2_d.html">   49</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> {</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keywordtype">float</span> x;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keywordtype">float</span> y;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>() :</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        x(0.0f),</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        y(0.0f) {</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    }</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>(<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> a) :</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        x(a.x),</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        y(a.y) {</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    }</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>(<span class="keywordtype">float</span> in_x, <span class="keywordtype">float</span> in_y) :</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        x(in_x),</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        y(in_y) {</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    }</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; operator+=(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; operator-=(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; operator*=(<span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; operator/=(<span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;};</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> operator+(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> operator-(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> operator*(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; lhs, <span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> operator*(<span class="keywordtype">float</span> lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> operator/(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; lhs, <span class="keywordtype">float</span> rhs);</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> operator/(<span class="keywordtype">float</span> lhs, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; rhs);</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="keyword">typedef</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> <a class="code" href="structsc2_1_1_point2_d.html">Vector2D</a>;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">typedef</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a> <a class="code" href="structsc2_1_1_point3_d.html">Vector3D</a>;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="structsc2_1_1_rect2_d.html">   89</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsc2_1_1_rect2_d.html">Rect2D</a> {</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> from;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a> to;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;};</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="structsc2_1_1_point2_d_i.html">   95</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsc2_1_1_point2_d_i.html">Point2DI</a> {</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keywordtype">int</span> x;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordtype">int</span> y;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <a class="code" href="structsc2_1_1_point2_d_i.html">Point2DI</a>(<span class="keywordtype">int</span> in_x = 0, <span class="keywordtype">int</span> in_y = 0) :</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        x(in_x),</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        y(in_y) {</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    }</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d_i.html">Point2DI</a>&amp; rhs) <span class="keyword">const</span>;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d_i.html">Point2DI</a>&amp; rhs) <span class="keyword">const</span>;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;};</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="structsc2_1_1_rect2_d_i.html">  109</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsc2_1_1_rect2_d_i.html">Rect2DI</a> {</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <a class="code" href="structsc2_1_1_point2_d_i.html">Point2DI</a> from;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <a class="code" href="structsc2_1_1_point2_d_i.html">Point2DI</a> to;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;};</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="structsc2_1_1_color.html">  115</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structsc2_1_1_color.html">Color</a> {</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    uint8_t r;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    uint8_t g;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    uint8_t b;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <a class="code" href="structsc2_1_1_color.html">Color</a>() :</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        r(255),</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        g(255),</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        b(255) {</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    }</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <a class="code" href="structsc2_1_1_color.html">Color</a>(uint8_t in_r, uint8_t in_g, uint8_t in_b) :</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        r(in_r),</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        g(in_g),</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        b(in_b) {</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    }</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;};</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="keyword">namespace </span>Colors {</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> White = <a class="code" href="structsc2_1_1_color.html">Color</a>(255, 255, 255);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Red = <a class="code" href="structsc2_1_1_color.html">Color</a>(255, 0, 0);</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Green = <a class="code" href="structsc2_1_1_color.html">Color</a>(0, 255, 0);</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Yellow = <a class="code" href="structsc2_1_1_color.html">Color</a>(255, 255, 0);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Blue = <a class="code" href="structsc2_1_1_color.html">Color</a>(0, 0, 255);</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Teal = <a class="code" href="structsc2_1_1_color.html">Color</a>(0, 255, 255);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Purple = <a class="code" href="structsc2_1_1_color.html">Color</a>(255, 0, 255);</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Black = <a class="code" href="structsc2_1_1_color.html">Color</a>(0, 0, 0);</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structsc2_1_1_color.html">Color</a> Gray = <a class="code" href="structsc2_1_1_color.html">Color</a>(128, 128, 128);</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;};</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a846ab3c3ff7c33caf7da2dff90a4a171">GetRandomScalar</a>();</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a0de5bf2e0593ea26ef8dd93ee5456744">GetRandomFraction</a>();</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="keywordtype">int</span> <a class="code" href="sc2__common_8h.html#aa35b0863b3931b50ce517abab8d06018">GetRandomInteger</a>(<span class="keywordtype">int</span> min, <span class="keywordtype">int</span> max);</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Container&gt;</div><div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="sc2__common_8h.html#abc67208faaf8b25c157b46bb6f96e5a5">  161</a></span>&#160;<span class="keyword">typename</span> Container::value_type&amp; <a class="code" href="sc2__common_8h.html#abc67208faaf8b25c157b46bb6f96e5a5">GetRandomEntry</a>(Container&amp; container) {</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keyword">typename</span> Container::iterator iter = container.begin();</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    std::advance(iter, GetRandomInteger(0, static_cast&lt;int&gt;(container.size()) - 1));</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">return</span> *iter;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;}</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a828525a11f27628914021c21736f2810">Distance2D</a>(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; a, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; b);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a9c649eca988aae078b7e72d087c2459f">DistanceSquared2D</a>(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; a, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; b);</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="keywordtype">void</span> <a class="code" href="sc2__common_8h.html#a32b33904e90d1de59f334c664971c70a">Normalize2D</a>(<a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; a);</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a5fc6c7967b887f2f9e1338db01a9d079">Dot2D</a>(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; a, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point2_d.html">Point2D</a>&amp; b);</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a68da467a343f431544f3cea7c105bcde">Distance3D</a>(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; a, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; b);</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a8019c6d22ca3004461370617a00a4644">DistanceSquared3D</a>(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; a, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; b);</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<span class="keywordtype">void</span> <a class="code" href="sc2__common_8h.html#ab4edfeead03941be04ed2fca1ed4e551">Normalize3D</a>(<a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; a);</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="keywordtype">float</span> <a class="code" href="sc2__common_8h.html#a9c24088000a232e811c93759fc08bad9">Dot3D</a>(<span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; a, <span class="keyword">const</span> <a class="code" href="structsc2_1_1_point3_d.html">Point3D</a>&amp; b);</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;}</div><div class="ttc" id="structsc2_1_1_point2_d_i_html"><div class="ttname"><a href="structsc2_1_1_point2_d_i.html">sc2::Point2DI</a></div><div class="ttdoc">2D integer point. </div><div class="ttdef"><b>Definition:</b> sc2_common.h:95</div></div>
<div class="ttc" id="structsc2_1_1_point3_d_html"><div class="ttname"><a href="structsc2_1_1_point3_d.html">sc2::Point3D</a></div><div class="ttdef"><b>Definition:</b> sc2_common.h:14</div></div>
<div class="ttc" id="structsc2_1_1_point2_d_html"><div class="ttname"><a href="structsc2_1_1_point2_d.html">sc2::Point2D</a></div><div class="ttdef"><b>Definition:</b> sc2_common.h:49</div></div>
<div class="ttc" id="sc2__common_8h_html_a5fc6c7967b887f2f9e1338db01a9d079"><div class="ttname"><a href="sc2__common_8h.html#a5fc6c7967b887f2f9e1338db01a9d079">sc2::Dot2D</a></div><div class="ttdeci">float Dot2D(const Point2D &amp;a, const Point2D &amp;b)</div></div>
<div class="ttc" id="namespacesc2_html"><div class="ttname"><a href="namespacesc2.html">sc2</a></div><div class="ttdef"><b>Definition:</b> sc2_action.h:9</div></div>
<div class="ttc" id="sc2__common_8h_html_a0de5bf2e0593ea26ef8dd93ee5456744"><div class="ttname"><a href="sc2__common_8h.html#a0de5bf2e0593ea26ef8dd93ee5456744">sc2::GetRandomFraction</a></div><div class="ttdeci">float GetRandomFraction()</div></div>
<div class="ttc" id="sc2__common_8h_html_aa35b0863b3931b50ce517abab8d06018"><div class="ttname"><a href="sc2__common_8h.html#aa35b0863b3931b50ce517abab8d06018">sc2::GetRandomInteger</a></div><div class="ttdeci">int GetRandomInteger(int min, int max)</div></div>
<div class="ttc" id="sc2__common_8h_html_a828525a11f27628914021c21736f2810"><div class="ttname"><a href="sc2__common_8h.html#a828525a11f27628914021c21736f2810">sc2::Distance2D</a></div><div class="ttdeci">float Distance2D(const Point2D &amp;a, const Point2D &amp;b)</div></div>
<div class="ttc" id="sc2__common_8h_html_a846ab3c3ff7c33caf7da2dff90a4a171"><div class="ttname"><a href="sc2__common_8h.html#a846ab3c3ff7c33caf7da2dff90a4a171">sc2::GetRandomScalar</a></div><div class="ttdeci">float GetRandomScalar()</div></div>
<div class="ttc" id="sc2__common_8h_html_a32b33904e90d1de59f334c664971c70a"><div class="ttname"><a href="sc2__common_8h.html#a32b33904e90d1de59f334c664971c70a">sc2::Normalize2D</a></div><div class="ttdeci">void Normalize2D(Point2D &amp;a)</div></div>
<div class="ttc" id="structsc2_1_1_color_html"><div class="ttname"><a href="structsc2_1_1_color.html">sc2::Color</a></div><div class="ttdoc">RGB Color. </div><div class="ttdef"><b>Definition:</b> sc2_common.h:115</div></div>
<div class="ttc" id="sc2__common_8h_html_ab4edfeead03941be04ed2fca1ed4e551"><div class="ttname"><a href="sc2__common_8h.html#ab4edfeead03941be04ed2fca1ed4e551">sc2::Normalize3D</a></div><div class="ttdeci">void Normalize3D(Point3D &amp;a)</div></div>
<div class="ttc" id="sc2__common_8h_html_a9c24088000a232e811c93759fc08bad9"><div class="ttname"><a href="sc2__common_8h.html#a9c24088000a232e811c93759fc08bad9">sc2::Dot3D</a></div><div class="ttdeci">float Dot3D(const Point3D &amp;a, const Point3D &amp;b)</div></div>
<div class="ttc" id="structsc2_1_1_rect2_d_html"><div class="ttname"><a href="structsc2_1_1_rect2_d.html">sc2::Rect2D</a></div><div class="ttdoc">2D rectangle. </div><div class="ttdef"><b>Definition:</b> sc2_common.h:89</div></div>
<div class="ttc" id="sc2__common_8h_html_a8019c6d22ca3004461370617a00a4644"><div class="ttname"><a href="sc2__common_8h.html#a8019c6d22ca3004461370617a00a4644">sc2::DistanceSquared3D</a></div><div class="ttdeci">float DistanceSquared3D(const Point3D &amp;a, const Point3D &amp;b)</div></div>
<div class="ttc" id="sc2__common_8h_html_a9c649eca988aae078b7e72d087c2459f"><div class="ttname"><a href="sc2__common_8h.html#a9c649eca988aae078b7e72d087c2459f">sc2::DistanceSquared2D</a></div><div class="ttdeci">float DistanceSquared2D(const Point2D &amp;a, const Point2D &amp;b)</div></div>
<div class="ttc" id="structsc2_1_1_rect2_d_i_html"><div class="ttname"><a href="structsc2_1_1_rect2_d_i.html">sc2::Rect2DI</a></div><div class="ttdoc">2D integer rectangle. </div><div class="ttdef"><b>Definition:</b> sc2_common.h:109</div></div>
<div class="ttc" id="sc2__common_8h_html_a68da467a343f431544f3cea7c105bcde"><div class="ttname"><a href="sc2__common_8h.html#a68da467a343f431544f3cea7c105bcde">sc2::Distance3D</a></div><div class="ttdeci">float Distance3D(const Point3D &amp;a, const Point3D &amp;b)</div></div>
<div class="ttc" id="sc2__common_8h_html_abc67208faaf8b25c157b46bb6f96e5a5"><div class="ttname"><a href="sc2__common_8h.html#abc67208faaf8b25c157b46bb6f96e5a5">sc2::GetRandomEntry</a></div><div class="ttdeci">Container::value_type &amp; GetRandomEntry(Container &amp;container)</div><div class="ttdef"><b>Definition:</b> sc2_common.h:161</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
